package com.RedRiver.hospitalsystem.personal_service.client;

import com.RedRiver.hospitalsystem.personal_service.client.param.*;
import com.RedRiver.hospitalsystem.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * contextId是项目名，name是client的名字
 */
@FeignClient(contextId = "SubjectClient",name="personal-service",path="personalService/subject")
public interface SubjectClient {

    @PostMapping("/findAllSubject")
     Result findAllSubject(@RequestBody PageForm form);

    @PostMapping("/findAllSubjectName")
     Result findNameSubject(@RequestBody SubjectNamePageForm subjectNamePageForm);

    @PostMapping("/findAllSubjectDepartment")
     Result findNameSubject(@RequestBody SubjectDepartmentPageForm subjectDepartmentPageForm);

    @PostMapping("/findSubjectById/{subjectId}")
     Result findNameSubject(@PathVariable("subjectId")Integer subjectId);

    @PostMapping("/findSubjectName/{subjectName}")
     Result findNameSubject(@PathVariable("subjectName") String subjectName);

    @PostMapping("/createSubject")
     Result createSubject(@RequestBody SubjectForm subjectForm);

    @PostMapping("/updateSubject")
     Result createSubject(@RequestBody NewSubjectForm newSubjectForm);

    @PostMapping("/updateSubject/{subjectId}")
    public Result delSubject(@PathVariable("subjectId")Integer subjectId);
}
